package org.qiyu.live.user.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * @ClassName: UserLoginDTO
 * @Description: TODO
 * @Author zhangguangyan
 * @Date 2023/08/27/ 00:01:15
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserLoginDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = -4290788036479984698L;


    private boolean isLoginSuccess;
    private String desc;
    private Long userId;
    private String token;

    public static UserLoginDTO loginError(String desc){
        return  UserLoginDTO.builder().isLoginSuccess(false).desc(desc).build();
    }
    public static UserLoginDTO loginSuccess(Long userId,String token){
        return  UserLoginDTO.builder().isLoginSuccess(true).userId(userId).token(token).build();
    }
}
